package com.lpy.book.JFrame;

import com.lpy.book.model.BorrowDetail;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

public class AdminBorrowInfo {
    JFrame jf;
    JTextField textField;
    JTextField textField_1;
    JTextField textField_2;
    JTextField textField_3;
    JTextField textField_4;
    JTextField textField_5;
    JButton btnNewButton_1;

    public AdminBorrowInfo() {
        jf = new JFrame();
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setTitle("111");
        jf.setSize(600, 800);
        jf.setLocation(400, 200);
        jf.setVisible(true);
        JPanel panel_1 = new JPanel();
        panel_1.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "\u4E66\u7C4D\u4FE1\u606F", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(255, 0, 0)));
        panel_1.setBounds(10, 10, 574, 350);
        //做一个表头栏数据  一维数组
        String[] title={"借书人","书名","状态","借书时间","还书时间"};
        /*具体的各栏行记录 先用空的二维数组占位*/
        String[][] dates={};
        /*然后实例化 上面2个控件对象*/
        DefaultTableModel model;
        model = new DefaultTableModel(dates,title);
        JTable table;
        table = new JTable(model);
        putDates(new BorrowDetail());//获取数据库数据放置table中
        panel_1.setLayout(null);
        JScrollPane jscrollpane = new JScrollPane();
        jscrollpane.setBounds(20, 22, 538, 314);
        jscrollpane.setViewportView(table);
        panel_1.add(jscrollpane);
        jf.getContentPane().add(panel_1);


    }

    private void putDates(BorrowDetail borrowDetail) {

    }

    public static void main(String[] args) {
        AdminBorrowInfo adminBorrowInfo = new AdminBorrowInfo();
    }
}
